package com.yangrui.app.exception;

import com.yangrui.app.util.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result handle(Exception e) {
        return Result.fail(0,e.getMessage());
    }
}
